var 

/**
 * The url of the test document. The request will have two parameters appended
 * to it: src and selectorFn.  They should be inserted into the framework 
 * script tag and the test function, respectively, before the document is
 * returned.  Refer to the included testDoc.php for an example.
 */
testDocURL = 'testDoc.php',

/**
 * If true, appends a third parameter with the current time to prevent
 * the above document from being cached.
 */
preventCaching = false,

/**
 * The maximum number of iterations each test runs.
 */
defaultIterations = 30, 
    
/**
 * The maximum number of milliseconds each test runs
 */
defaultTimeout = 200, // ms

/**
 * Minimum margin by which one framework's selector should be faster 
 * or slower than the others to be highlighted as such.
 */
defaultMinMargin = 0.1,

/**
 * The frameworks to include in the tests
 */    
frameworks = {
  'Dojo 1.0.2'       : { src: 'dojo.js',      selectorFn: 'dojo.query' },
  'jQuery 1.2.3'     : { src: 'jquery.js',    selectorFn: '$'  },
  'mootools 1.2beta2': { src: 'mootools.js',  selectorFn: '$$' },
  'Prototype 1.6.0.2': { src: 'prototype.js', selectorFn: '$$' }
},

/**
 * The selectors to test
 */
selectors = [
  { selector: 'body',                         expected: 1   },
  { selector: 'div',                          expected: 46  },
  { selector: 'body div',                     expected: 46  },
  { selector: 'div p',                        expected: 70  },
  { selector: 'div > p',                      expected: 64  },
  { selector: 'div + p',                      expected: 12  },
  { selector: 'div ~ p',                      expected: 165 },
  { selector: 'div p a',                      expected: 13  },
  { selector: 'div, p, a',                    expected: 567 },
  { selector: 'div.example',                  expected: 34  },
  { selector: 'div[class=example]',           expected: 34  },
  { selector: 'div[class^=exa]',              expected: 34  },
  { selector: 'div[class$=mple]',             expected: 36  },
  { selector: 'div[class^=exa][class$=mple]', expected: 34  },
  { selector: 'div.example, div.note',        expected: 37  },
  { selector: '.note',                        expected: 3   },
  { selector: 'ul.tocline2',                  expected: 0   },
  { selector: 'ul.toc li.tocline2',           expected: 12   },
  { selector: 'ul.toc > li.tocline2',         expected: 12   },
  { selector: '#title',                       expected: 0   },
  { selector: 'div#title',                    expected: 0   },
  { selector: 'h1#title',                     expected: 0   },
  { selector: 'h1#title + div > p',           expected: 0   },
  { selector: 'h1[id]:contains(Selectors)',   expected: 0   },
  { selector: 'a[href][lang][class]',         expected: 0   },
  { selector: 'div[class]',                   expected: 45   },
  { selector: 'selectors',                    expected: 0   },
  { selector: 'div[class*=e]',                expected: 44   },
  { selector: 'div[class|=dialog]',           expected: 0   },
  { selector: 'div[class!=made_up]',          expected: 45   },
  { selector: 'div[class!=example]',          expected: 11   },
  { selector: 'div[class~=example]',          expected: 34   },
  { selector: 'div:not(.example)',            expected: 12   },
  { selector: 'p:contains(selectors)',        expected: 32   },
  { selector: 'p:nth-child(even)',            expected: 100   },
  { selector: 'p:nth-child(2n)',              expected: 100   },
  { selector: 'p:nth-child(odd)',             expected: 133   },
  { selector: 'p:nth-child(2n+1)',            expected: 133   },
  { selector: 'p:nth-child(n)',               expected: 233   },
  { selector: 'p:only-child()',               expected: 2   },
  { selector: 'p:last-child()',               expected: 14   },
  { selector: 'p:first-child()',              expected: 26   },
  { selector: '.note',                        expected: 3   },
  { selector: 'imaginaryTag',                 expected: 0   },
  { selector: '#imaginaryId',                 expected: 0   },
  { selector: '.imaginaryClass',              expected: 0   }
];
